const {config,gulp,assetRev} = require("./gulp.config.js") ;
const {src,dest,series, parallel} = gulp;

const moveThird = async () =>{
	return src(config.srcPath + 'assets/third/**/*')
	.pipe(dest(config.prdPath + 'assets/third'))
}
const moveVideo = async () =>{
	return src(config.srcPath + 'assets/video/**/*')
	.pipe(dest(config.prdPath + 'assets/video'))
}
const moveJS = async () =>{
	return src(config.srcPath + 'assets/js/**/*')
	.pipe(dest(config.prdPath + 'assets/js'))
}
const moveImg = async () =>{
	return src(config.srcPath + 'assets/images/**/*')
	.pipe(dest(config.prdPath + 'assets/images'))
}
const moveFonts= async () =>{
	return src(config.srcPath + 'assets/fonts/**/*')
	.pipe(dest(config.prdPath + 'assets/fonts'))
}

const moveHtml = async () =>{
	console.log("HTML move start")
	return src(config.srcPath + '*.html')
	.pipe(assetRev())
	.pipe(dest(config.prdPath))
}

const moveCss = async () =>{
	return src(config.srcPath + 'assets/css/*.min.css')
		.pipe(dest(config.prdPath + 'assets/css'))
}

exports.build = series(moveHtml, parallel(moveThird,moveVideo,moveFonts, moveJS,moveCss,moveImg));

